export default {
  /**
   * 维修管理涉及的接口-----------------------------------------------------------------------------
   *
   */

  /**
   * 05010001---当前维修信息列表
   * /repair/repairinfo/list
   * @param  {number}  currentPage           当前页
   * @param  {number}  pageSize              每页显示数量
   * @param  {number}  createTime            开始时间 [开始，结束] 数组
   * @param  {number}  repairNum             维修单号
   * @param  {string}  devType               设备类型
   * @param  {string}  districtId            安装区域
   * @param  {string}  pointId               安装点位
   * @param  {string}  maintenanceId         维保单位
   *
   */
  "POST /repair/repairinfo/list": (req, res) => {
    res.send({
      trace_id: "15d9733dc1fe4072005ac112a01717a",
      request_id: "15d9733dc1fe4772002ac112a01715c",
      error_info: "执行成功",
      error_no: "0",
      data: {
        pagination: {
          current: 1,
          pageSize: 30,
          total: 40
        },
        list: [
          {
            repairId:"1",
            repairNum: "001",
            devCode: "1000",
            devName: "网络摄像头",
            maintenanceName: "海康威视",
            linkman: "张三",
            repairPerson:"报修人",
            createTime:1515554892000,
            status: "01",
            districtName:"杭州市",
            pointName:"具体点位1",
          },
          {
            repairId:"2",
            repairNum: "001",
            devCode: "1000",
            devName: "网络摄像头",
            maintenanceName: "海康威视",
            linkman: "张三",
            repairPerson:"报修人",
            createTime:1515554892000,
            status: "02",
            districtName:"杭州市",
            pointName:"具体点位2",
          }
        ]
      }
    });
  },


  /**
   * 05010002---历史维修信息列表
   * /repair/repairinfo/queryHisList
   * @param  {number}  currentPage           当前页
   * @param  {number}  pageSize              每页显示数量
   * @param  {number}  createTime            开始时间
   * @param  {number}  repairNum             维修单号
   * @param  {string}  devType               设备类型
   * @param  {string}  districtId            安装区域
   * @param  {string}  pointId               安装点位
   * @param  {string}  maintenanceId         维保单位
   * @param  {string}  overTime              超时（新增）01 是 02 否
   */
  "POST /repair/repairinfo/queryHisList": (req, res) => {
    res.send({
      trace_id: "15d9733dc1fe4072005ac112a01717a",
      request_id: "15d9733dc1fe4772002ac112a01715c",
      error_info: "执行成功",
      error_no: "0",
      data: {
        pagination: {
          current: 1,
          pageSize: 30,
          total: 40
        },
        list: [
          {
            repairId:"1",
            repairNum: "001",
            devCode: "1000",
            devName: "网络摄像头",
            maintenanceName: "海康威视",
            linkman: "张三",
            repairPerson:"报修人",
            createTime:1515554892000,
            endTime:1515554892000,
            districtName:"杭州市",
            pointName:"具体点位1",
          },
          {
            repairId:"2",
            repairNum: "001",
            devCode: "1000",
            devName: "网络摄像头",
            maintenanceName: "海康威视",
            linkman: "张三",
            repairPerson:"报修人",
            createTime:1515554892000,
            endTime:1515554892000,
            districtName:"杭州市",
            pointName:"具体点位2",
          }
        ]
      }
    });
  },



  /**
   * 05010003---报修
   * /repair/repairinfo/save
   * @param  {string}  districtId           安装区域
   * @param  {string}  pointId              安装点位
   * @param  {string}  faultType            故障现象
   * @param  {string}  faultDesc            故障描述
   * @param  {string}  infoSource           信息来源
   * @param  {string}  maintenanceId        维保单位
   * @param  {string}  repairPerson         维修人ID
   * @param  {string}  handleTime           处理时限
   * @param  {number}  devId                设备ID
   * @param  {string}  repairPhotoArray     维修图片ID ，隔开，支持多张
   */
  "POST /repair/repairinfo/save": (req, res) => {
    res.send({
      trace_id: "15d9733dc1fe4072005ac112a01717a",
      request_id: "15d9733dc1fe4772002ac112a01715c",
      error_info: "执行成功",
      error_no: "0"
    });
  },


  /**
   * 05010004---报修修改
   * /repair/repairinfo/update
   * @param  {string}  repairId              维修id
   * @param  {string}  districtId            安装区域
   * @param  {string}  pointId               安装点位
   * @param  {string}  faultType             故障现象
   * @param  {string}  faultDesc             故障描述
   * @param  {string}  infoSource            信息来源
   * @param  {string}  maintenanceId         维保单位
   * @param  {string}  repairPerson          维修人ID
   * @param  {string}  handleTime            处理时限
   * @param  {number}  devId                 设备ID
   * @param  {string}  repairPhotoArray      维修图片ID ，隔开，支持多张
   */
  "POST /repair/repairinfo/update": (req, res) => {
    res.send({
      trace_id: "15d9733dc1fe4072005ac112a01717a",
      request_id: "15d9733dc1fe4772002ac112a01715c",
      error_info: "执行成功",
      error_no: "0"
    });
  },


  /**
   * 05010005---获取报修信息详情
   * /repair/repairinfo/info/{repairId}
   * @param  {string}  repairId          维修id
   *
   */
  "POST /repair/repairinfo/info": (req, res) => {
    const { repairId } = req.body;
    if (repairId === '1') {
      res.send({
        trace_id: "15d9733dc1fe4072005ac112a01717a",
        request_id: "15d9733dc1fe4772002ac112a01715c",
        error_info: "执行成功",
        error_no: "0",
        data: {
          repairId: "1",
          repairNum: "10001",
          devId: "001",
          devCode: "002",
          devName: "设备1",
          devModel: "H0001",
          devType: "01",
          districtId: "6",
          pointId: "1",
          faultDesc: "描述",
          infoSource: "02",
          maintenanceId: "1",
          maintenanceName: "维保单位名称",
          maintainManId: "1",
          maintainManName: "维修人姓名",
          handleTime: 30,
          trademark: "海康威视",
          supplier: "海康威视",
          pointName: "武林街头",
          faultType: "01",
          linkman: "张三",
          repairPerson: "报修人",
          createTime: 1515554892000,
        },
        repairPhoto: [{
          uid: 'I100000000113',
          name: '211841154.jpg',
          url: 'http://www.qqzhi.com/uploadpic/2015-02-02/211841154.jpg',
        }, {
          uid: 'I100000000114',
          name: '211841154.jpg',
          url: 'http://www.qqzhi.com/uploadpic/2015-02-02/211841154.jpg',
        }],
      });
    }else{
      res.send({
        trace_id: "15d9733dc1fe4072005ac112a01717a",
        request_id: "15d9733dc1fe4772002ac112a01715c",
        error_info: "你访问的id不存在",
        error_no: "100"
      });
    }
  },


  /**
   * 05010006---导出
   * @param  {array}   repairIds        维修记录id
   */
  "POST /05010006": (req, res) => {
    res.send({
      trace_id: "15d9733dc1fe4072005ac112a01717a",
      request_id: "15d9733dc1fe4772002ac112a01715c",
      error_info: "执行成功",
      error_no: "0"
    });
  },




  /**
   * 05010007---维修处理（时间倒序）
   * /repair/repairprocess/queryRepairProcess
   * @param  {string}  repairId      维修id
   * repairStatus
   * 01 待办                    这个状态是不是没有？报修了就直接应该自动到审核中了？
   * 02 审核中                  显示初始报修详情
   *    审核中 + 有审核权限       出现审核表单
   * 03 已审核                   显示审核结果
        受理中（这个状态是否缺）   审核通过，这个新增一条
        审核中 + 有受理权限       出现受理表单
   * 04 已受理                   显示受理结果
   * 05 待验收                   。。。
   * 06 验收中                   。。。
   */
  "POST /repair/repairprocess/queryRepairProcess": (req, res) => {
    res.send({
      trace_id: "15d9733dc1fe4072005ac112a01717a",
      request_id: "15d9733dc1fe4772002ac112a01715c",
      error_info: "执行成功",
      error_no: "0",
      data:{
        list:[
        {
          status:"06",  // 状态：06----结束  ---显示 验收信息
          createTime:1515554892000, // 接收时间
          completeTime:1515554892000, // 完成时间
          processId:"6",
          creator:"创建人",  // 创建人
          handler:"处理人",  // 受理人
          handleDept:"处理部门",
          operateCon:"操作内容",
          handleResult:"1", //0不通过，1 通过
          acceptTime:1515554892000,
        },
        {
          status:"05",  // 状态：05----验收中 -- 显示 验收表单（此条信息只有审核权限且最新状态为此的人才有）
          processId:"5",
          createTime:1515554892000, // 创建时间
          handler:"处理人", //  审核人
        },
        {
          status:"04",  // 状态：04----已受理  ---显示 受理信息
          createTime:1515554892000, // 接收时间
          completeTime:1515554892000, // 完成时间
          processId:"4",
          creator:"创建人",  // 创建人
          handler:"处理人",  // 受理人
          handleDept:"处理部门",
          operateCon:"操作内容",
          acceptTime:1515554892000,
          processPhoto:[{
            uid: 'I100000000113',
            name: '211841154.jpg',
            url: 'http://www.qqzhi.com/uploadpic/2015-02-02/211841154.jpg',
          },
            {
            uid: 'I100000000114',
            name: '211841154.jpg',
            url: 'http://www.qqzhi.com/uploadpic/2015-02-02/211841154.jpg',
          }]
        },
        {
          status:"03",  // 状态：03----已审核  ---显示 审核信息
          createTime:1515554892000, // 创建时间
          completeTime:1515554892000, // 完成时间
          processId:"3",
          creator:"创建人",  // 创建人
          handler:"处理人", //  审核人
          handleDept:"处理部门",
          operateCon:"操作内容",
          acceptTime:1515554892000,
          handleResult:"0", //0不通过，1 通过 2、误报
          processPhoto:[{
            uid: 'I100000000113',
            name: '211841154.jpg',
            url: 'http://www.qqzhi.com/uploadpic/2015-02-02/211841154.jpg',
          },{
            uid: 'I100000000114',
            name: '211841154.jpg',
            url: 'http://www.qqzhi.com/uploadpic/2015-02-02/211841154.jpg',
          }]
        },
        {
          status:"02",  // 状态：02----审核中 -- 显示 审核表单（此条信息只有审核权限且最新状态为此的人才有）
          processId:"2",
          createTime:1515554892000, // 创建时间
          handler:"处理人", //  审核人
        }]
      }
    });
  },




  /**
   * 05010008---维修提醒
   * /repair/repairinfo/repairRemindList
   */
  "POST /repair/repairinfo/repairRemindList": (req, res) => {
    res.send({
      trace_id: "15d9733dc1fe4072005ac112a01717a",
      request_id: "15d9733dc1fe4772002ac112a01715c",
      error_info: "执行成功",
      error_no: "0",
      data:{
        list:[{
          repairId:"1",
          repairNum:"10000943",
          createTime:1515554892000,
          status:"01",
        },{
          repairId:"2",
          repairNum:"10000944",
          createTime:1515554892000,
          status:"02",
        },{
          repairId:"3",
          repairNum:"10000945",
          createTime:1515554892000,
          status:"03",
        }]
      }
    });
  },



  /**
   * 05010009---维修审核
   * /repair/repairinfo/repairCheck
   * @param  {string}  repairId       查ID
   * @param  {string}  handleResult   审核结果 0 不通过 1通过 2误报
   * @param  {string}  processDesc    审核内容
   */
  "POST /repair/repairinfo/repairCheck": (req, res) => {
    res.send({
      trace_id: "15d9733dc1fe4072005ac112a01717a",
      request_id: "15d9733dc1fe4772002ac112a01715c",
      error_info: "执行成功",
      error_no: "0"
    });
  },


  /**
   * 05010010---维修验收
   * /repair/repairinfo/repairAcceptanceCheck
   * @param  {string}  repairId       查ID
   * @param  {string}  handleResult   审核结果 0 不通过 1通过
   * @param  {string}  processDesc    审核内容
   * @param  {string}  processPhoto   验收图片
   *
   */
  "POST /repair/repairinfo/repairAcceptanceCheck": (req, res) => {
    res.send({
      trace_id: "15d9733dc1fe4072005ac112a01717a",
      request_id: "15d9733dc1fe4772002ac112a01715c",
      error_info: "执行成功",
      error_no: "0"
    });
  },



  /**
   * 05010011---根据维修进程ID ，查找关联备件
   * /device/deviceattauserecord/list
   * @param  {string}  processId                流程ID
   */
  "POST /device/deviceattauserecord/list": (req, res) => {
    res.send({
      trace_id: "15d9733dc1fe4072005ac112a01717a",
      request_id: "15d9733dc1fe4772002ac112a01715c",
      error_info: "执行成功",
      error_no: "0",
      data:{
        pagination: {
          current: 1,
          pageSize: 10,
          total: 9
        },
        list:[{
          attaId:"1",
          attaCode: "001",
          attaName: "网络摄像头",
          modelNum: "H002",
          usedNum: "1000",
        },{
          attaId:"1",
          attaCode: "001",
          attaName: "网络摄像头",
          modelNum: "H002",
          usedNum: "2",
        }]
      }
    });
  },

};
